package common

import "src/zeus/linmath"

type Rect struct {
	MinX, MaxX int
	MinY, MaxY int
}

func NewRect(center *linmath.Vector2, size *linmath.Vector2) *Rect {
	halfRect := size.Mul(0.5)

	minPos := center.Sub(halfRect)
	maxPos := center.Add(halfRect)

	return &Rect{
		MinX: int(minPos.X),
		MinY: int(minPos.Y),
		MaxX: int(maxPos.X),
		MaxY: int(maxPos.Y),
	}
}
